package derp;

public class Statistic {
	private int numResult;
	private boolean boolResult;
	private String strResult;
	private String name;
	private String type;
	private String displayString;
	private String displayKey;
	
	public Statistic(String name, String strResult, String type, String ){
		this.name = name;
		this.strResult = strResult;
		this.type = type;
	}
	public Statistic(String name, boolean boolResult, String type){
		this.name = name;
		this.boolResult = boolResult;
		this.type = type;
	}
	public Statistic(String name, int numResult, String type){
		this.name = name;
		this.numResult = numResult;
		this.type = type;
	}
	
	public String getName(){
		return name;
	}
	
	public String toString(){
		return name + " " + type;
	}
	
	public Object get(){
		if (type.equals("int"))
			return numResult;
		if (type.equals("bool"))
			return boolResult;
		if (type.equals("str"))
			return strResult;
		else 
			return null;
	}
	
	public void set(Object obj){
		if (type.equals("int"))
			this.numResult = (Integer) obj;
		if (type.equals("bool"))
			this.boolResult = (Boolean) obj;
		if (type.equals("str"))
			this.strResult = (String) obj;
	}
}
